<h1><?= (isset($heading)) ? $heading : '' ?> </h1>

<?=form_open($this->uri->uri_string(), array('id' => 'register_form'))?>
	<!--USERNAME-->
	<p><label for="user_name"><?=$this->lang->line('FAL_user_name_label')?>:</label>
	<?=form_input(array('name'=>'user_name', 
	                       'id'=>'user_name',
	                       'maxlength'=>'45', 
	                       'size'=>'45',
	                       'value'=>(isset($this->fal_validation) ? $this->fal_validation->{'user_name'} : '')))?>
    <?=(isset($this->fal_validation) ? $this->fal_validation->{'user_name'.'_error'} : '')?></p>
	 
    <!--PASSWORD-->
    <p><label for="password"><?=$this->lang->line('FAL_user_password_label')?>:</label>
	<?=form_password(array('name'=>'password', 
	                       'id'=>'password',
	                       'maxlength'=>'16', 
	                       'size'=>'16',
	                       'value'=>''))?>
    <?=(isset($this->fal_validation) ? $this->fal_validation->{'password'.'_error'} : '')?></p>
    
     <!--CONFIRM PASSWORD-->
     <p><label for="password_confirm"><?=$this->lang->line('FAL_user_password_confirm_label')?>:</label>
	<?=form_password(array('name'=>'password_confirm', 
	                       'id'=>'password_confirm',
	                       'maxlength'=>'16', 
	                       'size'=>'16',
	                       'value'=>''))?>
    <?=(isset($this->fal_validation) ? $this->fal_validation->{'password_confirm'.'_error'} : '')?></p>
    <!--FIRST NAME-->
	<p><label for="first_name"><?=$this->lang->line('FAL_user_first_name_label')?>:</label>
	<?=form_input(array('name'=>'first_name', 
	                       'id'=>'first_name',
	                       'maxlength'=>'45', 
	                       'size'=>'45',
	                       'value'=>(isset($this->fal_validation) ? $this->fal_validation->{'first_name'} : '')))?>
    <?=(isset($this->fal_validation) ? $this->fal_validation->{'first_name'.'_error'} : '')?></p>
    <!--LAST NAME-->
	<p><label for="last_name"><?=$this->lang->line('FAL_user_last_name_label')?>:</label>
	<?=form_input(array('name'=>'last_name', 
	                       'id'=>'last_name',
	                       'maxlength'=>'45', 
	                       'size'=>'45',
	                       'value'=>(isset($this->fal_validation) ? $this->fal_validation->{'last_name'} : '')))?>
    <?=(isset($this->fal_validation) ? $this->fal_validation->{'last_name'.'_error'} : '')?></p>
    <!--MOBILE NO-->
	<p><label for="mobile_no"><?=$this->lang->line('FAL_user_mobile_no_label')?>:</label>
	<?=form_input(array('name'=>'mobile_no', 
	                       'id'=>'mobile_no',
	                       'maxlength'=>'12', 
	                       'size'=>'45',
	                       'value'=>(isset($this->fal_validation) ? $this->fal_validation->{'mobile_no'} : '')))?>
    <?=(isset($this->fal_validation) ? $this->fal_validation->{'mobile_no'.'_error'} : '')?></p>
    <!--LAND LINE NO-->
	<p><label for="land_line_no"><?=$this->lang->line('FAL_user_land_line_no_label')?>:</label>
	<?=form_input(array('name'=>'land_line_no', 
	                       'id'=>'land_line_no',
	                       'maxlength'=>'10', 
	                       'size'=>'45',
	                       'value'=>(isset($this->fal_validation) ? $this->fal_validation->{'land_line_no'} : '')))?>
    <?=(isset($this->fal_validation) ? $this->fal_validation->{'land_line_no'.'_error'} : '')?></p>
    <!--ADDRESS-->
	<p><label for="land_line_no"><?=$this->lang->line('FAL_user_address_label')?>:</label>
	<?=form_textarea(array('name'=>'address', 
	                       'id'=>'address',
						   'cols' => '32',
						   'rows' => '4',
	                       'maxlength'=>'10', 
	                       'size'=>'45',
	                       'value'=>(isset($this->fal_validation) ? $this->fal_validation->{'address'} : '')))?>
    <?=(isset($this->fal_validation) ? $this->fal_validation->{'address'.'_error'} : '')?></p>
    <!--DATE OF BIRTH-->
	<p><label for="last_name"><?=$this->lang->line('TG_user_dob_label')?>:</label>
	<?=form_dropdown('date',$date_options,(isset($this->fal_validation) ? $this->fal_validation->{'date'} : ''))?><?=form_dropdown('month',$month_options,(isset($this->fal_validation) ? $this->fal_validation->{'month'} : ''))?><?=form_dropdown('year',$year_options,(isset($this->fal_validation) ? $this->fal_validation->{'year'} : ''))?>
	 </p>
	<!--GENDER-->
	<p><label for="gender">
	<? $male ='';
		$female ='';
	$gender = (isset($this->fal_validation) ? $this->fal_validation->{'gender'} : '')?>
	 <?(($gender) == 'M' ? $male=TRUE : '');(($gender) == 'F' ? $female=TRUE : '')
	?>
	<?=$this->lang->line('TG_user_gender_label')?>:</label>
	<?=$this->lang->line('TG_user_gender_male_label')?><?=form_radio('gender','M',$male,'checked')?>
	<?=$this->lang->line('TG_user_gender_female_label')?><?=form_radio('gender','F',$female)?>
	 </p>
    <!--EMAIL-->
    <p><label for="email"><?=$this->lang->line('FAL_user_email_label')?>:</label>
	<?=form_input(array('name'=>'email', 
	                       'id'=>'email',
	                       'maxlength'=>'120', 
	                       'size'=>'45',
	                       'value'=>(isset($this->fal_validation) ? $this->fal_validation->{'email'} : '')))?>
    <?=(isset($this->fal_validation) ? $this->fal_validation->{'email'.'_error'} : '')?></p>
    
    <!--CAPTCHA (security image)-->
	<?php
	if ($this->config->item('FAL_use_captcha_register'))
	{?>
	<p><label for="security"><?=$this->lang->line('FAL_captcha_label')?>:</label>
	<?=form_input(array('name'=>'security', 
	                       'id'=>'security',
	                       'maxlength'=>'45', 
	                       'size'=>'45',
	                       'value'=>''))?>
    <?=(isset($this->fal_validation) ? $this->fal_validation->{'security'.'_error'} : '')?>
    <?=$this->load->view($this->config->item('FAL_captcha_img_tag_view'), null, true)?></p>
    <?php }?>
    <!-- END CAPTCHA (security image)-->
<?php
if ($this->config->item('FAL_use_country'))
{?>    
    <p><label><?=$this->lang->line('FAL_user_country_label')?>:</label>
	<?=form_dropdown('country_id',
	                 $countries,
	                 (isset($this->fal_validation) ? $this->fal_validation->country_id : 0))?>
    <?=(isset($this->fal_validation) ? $this->fal_validation->{'country_id'.'_error'} : '')?></p>
<?php
}
$buttonSubmit = $this->lang->line('FAL_agree_label');
$buttonCancel = $this->lang->line('FAL_cancel_label');
$callConfirm = 'confirmDecline();';
if ($this->lang->line('FAL_terms_of_service_message_register') != '')
{
    $buttonSubmit = $this->lang->line('FAL_agree_label');
    $buttonCancel = $this->lang->line('FAL_donotagree_label');
    $callConfirm = 'confirmDecline();';
?>
<p><textarea name="rules" class="textarea" rows="8" cols="50" readonly="readonly">
<?=$this->lang->line('FAL_terms_of_service_message')?>
</textarea>
</p>
<?php    
}?>
    
	<?=form_submit(array('name'=>'register',
						  'class'=>'submit',
	                     'value'=>$buttonSubmit))?>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	
	<?=form_submit(array('type'=>'button',
	                     'name'=>'cancel',
	                     'class'=>'button',
	                     'value'=>$buttonCancel,
	                     'onclick'=>$callConfirm))  ?>
  
<?=form_close()?>
<script language="JavaScript" type="text/javascript">
<!--
function confirmDecline() 
{
    if (confirm('<?=$this->lang->line('FAL_register_cancel_confirm')?>')) 
		location = '<?=site_url()?>';
} 
//-->
</script>
<!--END REGISTER DIV-->